package com.iwe3.protal.mapper;

import com.iwe3.protal.common.PageResult;
import com.iwe3.protal.entity.BookEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.ResultType;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BookMapper {

    @ResultType(BookEntity.class)
    @Select("select * from t_book where typeId = #{typeId}")
    List<BookEntity> findAllByTypeId(@Param("typeId") Integer typeId);

    @ResultType(BookEntity.class)
    @Select("select * from t_book")
    List<BookEntity> findAll();

    @ResultType(BookEntity.class)
    @Select("select * from t_book where id = #{id}")
    BookEntity getById(Long id);

}
